#ifndef __DHT11_H
#define __DHT11_H

#include "stm32f10x.h"
#include "bitbanding.h"

#define DHT11_OUT do{GPIOA->CRH &=~0xF;GPIOA->CRH |= 0x3;}while(0) 
#define DHT11_IN  do{GPIOA->CRH &=~0xF;GPIOA->CRH |= 0x4;}while(0) 

#define DHT11_HIGH PAout(8)=1
#define DHT11_LOW  PAout(8)=0

#define DHT11 PAin(8)

void dht11_init(void);
int dht11_read(uint8_t *data);

#endif
